#!/usr/bin/env node

const Koa = require('koa')
const app = new Koa()
const logger = require('./md/logger.js')

//app.use(async(ctx, next) => { //M-logger
  //const start = Date.now()
  //await next()
  //const end = Date.now()
  //const cost = end - start
  //console.log(`${ctx.method} ${ctx.path} ${cost}ms`)
//})

app.use(logger)

app.use((ctx, next) => { //M-hello
  ctx.body = 'hello world'//响应体
})

app.listen(8080)

console.log('hello koa2')
